package com.sankei.rocketmq;

import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * Classname: ConsumerService
 * Description:
 *
 * @Author: dxy
 * @Create: 2025/2/7-19:37
 * @Version: v1.0
 */
@Component("producerService")
public class ProducerService {

    @Autowired
    RocketMQTemplate rocketMQTemplate;

    public void sendMessage(){
        for (int i = 0; i < 10; i++) {
            rocketMQTemplate.convertAndSend("java-rocketmq","Message"+i);
        }
    }


}
